﻿using System.ComponentModel.DataAnnotations;
using YNTK.Common.Enum;
using YNTK.Dependency;

namespace YNTK.Employees.Entitys.Dto
{
    /// <summary>
    /// 添加员工请求模型
    /// </summary>
    [SuppressSniffer]
    public class AddEmployeeRequestModel
    {
        /// <summary>
        /// 机构id
        /// </summary>
        [Required(ErrorMessage = "请选择当前员工所属机构")]
        public string mechanismId { get; set; }

        /// <summary>
        /// 员工编号
        /// </summary>
        [Required(ErrorMessage = "员工编号不能为空")]
        public string code { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage = "姓名不能为空")]
        public string realName { get; set; }

        /// <summary>
        /// 身份证号
        /// </summary>
        [RegularExpression(@"(^\d{18}$)|(^\d{15}$)|(^\d{17}(\d|X|x)$)", ErrorMessage = "请输入正确的身份证号")]
        public string certificatesNumber { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空"), RegularExpression(@"^\+?\d{0,4}?[1][3-8]\d{9}$", ErrorMessage = "请输入正确的手机号")]
        public string mobilePhone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [DataType(DataType.EmailAddress)]
        [RegularExpression("^[\\w-]+@[\\w-]+\\.(com|net|org|edu|mil|tv|biz|info)$", ErrorMessage = "邮箱格式错误请输入正确的邮箱")]
        [StringLength(160, ErrorMessage = "邮箱太长了")]
        public string email { get; set; }

        /// <summary>
        /// 劳动关系(0.抽调 1.合同工 2.派遣)
        /// </summary>
        [Required(ErrorMessage = "请选择劳动关系")]
        public LaborRelationsEnum laborRelations { get; set; }

        /// <summary>
        /// 性别(0.男 1.女)
        /// </summary>
        [Required(ErrorMessage = "请选择性别")]
        public SexEnum sex { get; set; }

        /// <summary>
        /// 薪酬方式(0.年薪制 1.月薪制)
        /// </summary>
        [Required(ErrorMessage = "请选择薪酬方式")]
        public PayWayEnum payWay { get; set; }

        /// <summary>
        /// 是否临时用工(true.是 false.否)
        /// </summary>
        [Required(ErrorMessage = "请选择是否为临时用工")]
        public bool temporaryWork { get; set; }

        /// <summary>
        /// 员工状态(0.实习生 1.试用 2.兼职 3.在职 4.离职 5.停职留薪 6.退休 7.返聘)
        /// </summary>
        [Required(ErrorMessage = "请选择员工状态")]
        public EmployeeStateEnum state { get; set; }

        /// <summary>
        /// 入职日期
        /// </summary>
        [Required(ErrorMessage = "入职日期不能为空")]
        public DateTime? dateEntry { get; set; }

        /// <summary>
        /// 在岗情况(0.正常 1.请假 2.出差)
        /// </summary>
        [Required(ErrorMessage = "请选择在岗情况")]
        public DutyStateEnum dutyState { get; set; }
    }
}
